const TransformPages = require('uni-read-pages')
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const tfPages = new TransformPages({
	includes: ['path', 'name', 'meta']
})
console.log(tfPages)
module.exports = {
	configureWebpack: {
		plugins: [
			new tfPages.webpack.DefinePlugin({
				ROUTES: JSON.stringify(tfPages.routes)
			}),
			new CopyWebpackPlugin([{
				from: path.join(__dirname, '/static'),
				to: path.join(__dirname + '/unpackage/', 'dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev',
					process.env.UNI_PLATFORM, '/')
			}])
		]
	}
}
